<?php

namespace app\index\controller\my;

use app\index\model\UM as UM;
use app\index\service\InviteService;
use ShidianUtil\Thinkphp\Response\ApiResponse;
use think\APP;

/**
 * Invite 控制器
 * Class Invite
 * @package app\index\controller\my;
 * @link https://www.kancloud.cn/manual/thinkphp6_0/1037509
 * @see \app\index\validate\my\Invite
 */
class Invite
{
    // service
    private InviteService $service;

    public function __construct(InviteService $inviteService)
    {
        $this->service = $inviteService;
    }

    /**
     * 详情
     * @param UM $user
     * @return ApiResponse
     * @url /my/invite/read
     */
    public function read(UM $user): ApiResponse
    {
        return ApiResponse::success($this->service->read($user));
    }

}
